<?php TPL::output('m/header_meta.tpl.htm'); ?>
<div class="column-details">
    <div class="column-info" style="overflow: hidden">
        <a href="javascript:;">
            <img src="<?php echo $this->info['column_pic'];?>" width="60" height="60" class="pull-left" style="width: 60px;border-radius: 5px"
                 onerror="javascript:this.src='/static/common/topic-max-img.png';">
        </a>
        <div class="pull-right text-info">
            <!--专栏名称-->
            <h3><a href="javascript:;"><?php echo $this->info['column_name'];?></a></h3>
            <p class="text-color-999" style="margin: 2px 0 5px;font-size: 12px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;word-break: break-all;">
                <?php echo $this->info['column_description'];?>
            </p>
            <p class="text-color-999">
                <span><i class="glyphicon glyphicon-file"></i> <?php echo intval($this->info['article_count']);?></span>&nbsp;&nbsp;
                <span><i class="glyphicon glyphicon-eye-open"></i> <?php echo intval($this->info['views_count']);?></span>&nbsp;&nbsp;
                <span><i class="glyphicon glyphicon-briefcase"></i> <?php echo intval($this->info['focus_count']);?></span>&nbsp;&nbsp;
                <span><i class="glyphicon glyphicon-user"></i> <?php echo get_user_name_by_uid($this->info['uid']);?></span>
            </p>
        </div>
    </div>
</div>
<div class="gztj_tab phb_tab">
    <ul>
        <li class="cur tabs" type="new"><a href="javascript:;">最新</a></li>
        <li class="tabs" type="hot"><a href="javascript:;">热门</a></li>
        <li class="tabs" type=""><a href="javascript:;">专栏详情</a></li>
    </ul>
</div>
<div class="aw-question-list">
      <ul id="article_listview"></ul>
</div>
<div class="aw-question-list">
    <div class="column-details"><?php echo ($this->info['column_description']);?></div>
</div>
<script src="<?php echo base_url();?>/static/mobile/layui/layui.js"></script>
<script type="text/javascript">
   layui.use('flow', function () {
        var $ = layui.jquery;
        var flow = layui.flow;
        var page= 1;
        var is_verify=0;
        var url = G_BASE_URL + '/column/ajax/get_column_articles/column_id-<?php echo $this->info["column_id"];?>';
        $(".tabs").click(function(){
            var sort=$(this).attr('type');
            $(this).addClass('cur').siblings().removeClass('cur');
            if($(this).index()==2){
                $(".aw-question-list").eq(1).show();    
                $(".aw-question-list").eq(0).hide();    
            }else{
                $(".aw-question-list").eq(0).show();    
                $(".aw-question-list").eq(1).hide();    
                $("#article_listview").empty();
                load_data(sort);
            }
        });
        function load_data(sort){
                flow.load({
                    elem: '#article_listview',
                    end: 'SORRY~!没有了',
                    done: function (page, next) {
                        var lis = [];
                        $.get(url + '?page=' + page+'&sort='+sort, function (res) {
                                if ((res.rsm.list).length < 1) {
                                    AWS.DingTalk.showToast('', '暂无更多内容');
                                }
                                var html = '';
                                if ((res.rsm.list).length >0) {
                                layui.each(res.rsm.list, function (index, item) {
                                    html += '<li><div class="mod-body">' +
                                        '<h2><a type="aq" href="m/article/'+item.id+'">'+item.title+'</a></h2></div>' +
                                        '<div class="mod-footer">' +
                                        '<a href="m/people/'+item.uid+'">'+item.user_name+'</a>发起了文章  ' +
                                        '<span class="pull-right color-999">'+item.time+'</span></div></li>';
                                });
                            }
                                lis.push(html);
                                next(lis.join(''), page < res.rsm.pages);
                        }, 'json');
                    }
                });
            
        }


  $(".tabs").eq(0).click();
    });

</script>
<?php TPL::output('m/footer.tpl.htm'); ?>